using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using SageKing.Database.Contracts;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace SageKing.OpenIddict.UI.Api;

public class ApplicationViewModel : EntityBase<string>
{
    [Required(AllowEmptyStrings = false)]
    public string ClientId { get; set; }

    public string DisplayName { get; set; }

    public string Type { get; set; } = ClientTypes.Confidential;

    [RequiredIfClientTypeIs(ClientTypes.Confidential)]
    public string ClientSecret { get; set; }

    public bool RequirePkce { get; set; }

    public bool RequireConsent { get; set; }

    public IEnumerable<string> Permissions { get; set; } = [];
    public IEnumerable<string> RedirectUris { get; set; } = [];
    public IEnumerable<string> PostLogoutRedirectUris { get; set; } = [];

    public bool Status { get; set; }
    public int OrderNo { get; set; }

    public string Remark { get; set; }
}
